<div ng-init="init();" class="kmi-layout-content B1801-content">
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="brand-title">
            <div class="custom" ng-if="companyName">
                <div class="title" ng-bind="companyName"></div>
                <img src="" alt="" class="brand">
                <div class="gap"></div>
            </div>
            <div class="digiwin">
                <img src="image/smes_v340/logo_ch.png" alt="">
                <img src="image/smes_v340/logo_en.png" alt="">
            </div>
        </div>
        <div class="header-title" ng-bind="'B1801.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page">
            <div class="kmi-report-panel"></div>
            <div class="grid-content adjustment_main" style="overflow:hidden;">
                <div class="content-title">
                    <label ng-bind="'B1801.searchResult' | translate" style="color:#006e7d;font-weight: bold;padding-top: 8px;padding-left: 8px;"></label>
                </div>
                <div class="kmi-list column-selector" style="height:100%">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.MONo">
                                <input ng-model="list_filter.MONo">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.MONo = false;list_filter.MONo = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.MONo">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.MONo = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column10'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'MONo'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('MONo')"></div>
                            </div>
                        </div>
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.RWOMESNO">
                                <input ng-model="list_filter.RWOMESNO">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.RWOMESNO = false;list_filter.RWOMESNO = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.RWOMESNO">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.RWOMESNO = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column01'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'RWOMESNO'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('RWOMESNO')"></div>
                            </div>
                        </div>
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.ReportDate">
                                <input ng-model="list_filter.ReportDate">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.ReportDate = false;list_filter.ReportDate = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.ReportDate">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.ReportDate = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column02'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'ReportDate'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('ReportDate')"></div>
                            </div>
                        </div>
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.LotNo">
                                <input ng-model="list_filter.LotNo">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.LotNo = false;list_filter.LotNo = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.LotNo">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.LotNo = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column03'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'LotNo'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('LotNo')"></div>
                            </div>
                        </div>
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.op">
                                <input ng-model="list_filter.op">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.op = false;list_filter.op = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.op">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.op = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column04'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'op'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('op')"></div>
                            </div>
                        </div>
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.equipment">
                                <input ng-model="list_filter.equipment">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.equipment = false;list_filter.equipment = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.equipment">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.equipment = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column05'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'equipment'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('equipment')"></div>
                            </div>
                        </div>
                        <!-- 20240314 modify by wenwei for M#149118: [sMES]日結調帳作業-ERP拋轉欄位需要有搜尋/篩選功能[台欣國際] -->
                        <div class="kmi-list__column head-controls" style="flex:1;">
                            <div class="filter" ng-show="filterSH.SendResult_display">
                                <input ng-model="list_filter.SendResult_display">
                                <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                                   ng-click="filterSH.SendResult_display = false;list_filter.SendResult_display = '';">clear</i>
                            </div>
                            <div class="order" ng-hide="filterSH.SendResult_display">
                                <i class="material-icons search" style="z-index:1;" ng-click="filterSH.SendResult_display = true">search</i>
                                <label ng-bind="'B1801.queryList_main.column06'| translate"></label>
                                <i class="material-icons" ng-show="order_by_mode.name == 'SendResult_display'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                                <div class="kmi-can-click" ng-click="orderbychange('SendResult_display')"></div>
                            </div>
                        </div>
                        <!-- <div class="kmi-list__column" style="flex:1;" ng-bind="'B1801.queryList_main.column06' | translate"></div> -->
                    </div>
                        <div class="kmi-list__row-content">
                            <div class="kmi-list__row" ng-repeat="data in getPages(adjustInfo.adjustment_currently_main, PageConfig) | filter: list_filter track by $index" style="height:36px;">
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.MONo"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.RWOMESNO"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.ReportDate"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.LotNo"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.op"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.equipment"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.SendResult_display"></div>
                                <div class="kmi-can-click" ng-click="itemClick(data);"></div>
                            </div>
                        </div>
                    </div>
            </div>

            <div class="grid-content adjustment_detail" style="overflow:hidden;" >
                <div class="content-title" style="margin: 5px;" style="height:36px;display: flex;justify-content: space-between">
                    <label ng-bind="'B1801.editRecord' | translate" style="color:#006e7d;font-weight: bold;margin-right: 20px;padding-top: 8px;padding-left: 8px;"></label>

                    <div style="display:flex;flex-direction:row;justify-content: flex-end;">
                        <div ng-if="clickItem.SendResult == 2" class="kmi-button kmi-button-confrim btn-confirm" ng-click="changeState();" style="width:150px;">
                            <label ng-bind="'B1801.changeState' | translate"></label>
                            <div class="kmi-can-click"></div>
                        </div>
                        <div ng-if="adjustInfo.SendResult_temp!=0" class="kmi-button kmi-button-confrim btn-confirm" ng-click="record();" style="width:100px;">
                            <label ng-bind="'B1801.record' | translate"></label>
                            <div class="kmi-can-click"></div>
                        </div>
                        <div ng-if="adjustInfo.SendResult_temp==0" class="kmi-button kmi-button-confrim btn-confirm" ng-click="record();" style="width:100px;">
                            <label ng-bind="'B1801.record' | translate"></label>
                            <div class="kmi-can-click"></div>
                        </div>
                        <div ng-if="adjustInfo.SendResult_temp==0" class="kmi-button kmi-button-confrim btn-confirm" ng-click="add();" style="width:100px;">
                            <label ng-bind="'B1801.add' | translate"></label>
                            <div class="kmi-can-click"></div>
                        </div>
                    </div>
                  
                </div>

                <div class="kmi-list column-selector" style="height:100%">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column01' | translate"></div>
                        <!--
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column02' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column03' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column04' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column05' | translate"></div>
                        -->
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column07' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column08' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column09' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column11' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;"
                             ng-bind="'B1801.queryList_detail.column12' | translate"></div>

                    </div>
                    <div class="kmi-list__row-content">
                        <div class="kmi-list__row" ng-repeat="data in getPages(adjustInfo.adjustment_currently_detail, PageConfig) track by $index" style="height:36px;">
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.RWOMESNO"></div>
                            <!--
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.ReportDate"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.LotNo"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.op"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.equipment"></div>
                            -->
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.user"></div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <span ng-if="data.ReportType!='0'" ng-bind="data.EMPTime_s" />
                                <span ng-if="data.ReportType=='0' && data.SendResult==1" ng-bind="data.EMPTime_s" />
                                <input ng-if="(data.ReportType=='0' && data.SendResult==0)" type="text"
                                       mdl-calculater="data.EMPTime_s" mdl-calculater-decimal-length="3" />
                            </div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <span ng-if="data.ReportType!='1'" ng-bind="data.EQPTime_s" />
                                <span ng-if="data.ReportType=='1' && data.SendResult==1" ng-bind="data.EQPTime_s" />
                                <input ng-if="(data.ReportType=='1' && data.SendResult==0)" type="text"
                                       mdl-calculater="data.EQPTime_s" mdl-calculater-decimal-length="3" />
                            </div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.MONo"></div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <span ng-if="data.SendResult==1" ng-bind="data.QTY" />
                                <input ng-if="(data.SendResult==0)" type="text"
                                       mdl-calculater="data.QTY" mdl-calculater-decimal-length="3" />
                            </div>
                            </div>
                        </div>
                </div>
            </div>

        </div>
        <div class="kmi-layout-footer">
            <button ng-disabled="adjustInfo.SendResult_temp!=0" class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1"
                    ng-click="confirm();">
                <i class="material-icons">done</i>
            </button>
        </div>
    </div>
</div>
